package CCRMClient.Controllers;

import Common.SERVER_COMMANDS;
import Common.ServerRequest;
import Common.Entities.Employee;

/**
 * This class controls the client side of CCRM Client application
 * @author ori ziv
 *
 */
public class LoginMng {
	private static Employee user;

	/**
	 * @return the user
	 */
	public static Employee getUser() {
		return user;
	}

	/**
	 * @param user the user to set
	 */
	public static void setUser(Employee user) {
		LoginMng.user = user;
	}

	public static ServerRequest loginUser (String userName, char[] rawPassword) {
		user = new Employee();
		user.setUserName(userName);
		user.setPassword(rawPassword);
		return new ServerRequest (SERVER_COMMANDS.LOG_IN, userName, user);
	}
}
